<template>
	<div class="movie_body">
		<ul>
			<li v-for="item in NowPlayingList" :key="item.id">
				<div class="pic_show"><img :src="item.url"/></div>
				<div class="info_list">
					<h2>{{item.name}}</h2>
					<p>观众评<span class="grade">{{item.grade}}</span></P>
					<p>主演：{{item.actor}}</P>
					<p>今天{{item.movie}}家影院放映{{item.Playingnum}}场</p >
				</div>
				<div class="btn_mall">购票</div>
			</li>
		</ul>
	</div>
</template>

<script>
	export default {
		name:'NowPlaying',
		data(){
				return{
				NowPlayingList:[],
				}
			},
		created(){
			this.getPlayingData();
		},
		methods:{
			getPlayingData(){
				var that =this;
				axios.get('/mock/NowPlaying.json')
				  .then(function (response) {
				    console.log(response);
					if(response.status == 200){
						if(response.data && response.data.NowPlayingList){
							that.NowPlayingList=response.data.NowPlayingList;
						}
					}
				  })
				  .catch(function (error) {
				    console.log(error);
				  });
		}
		}
	}
</script>

<style>
	.movie_body{
		width: 100%;
		position: absolute;
		top: 100px;
		bottom: 45px;
		flex: 1;
		overflow: auto;
	}
	.movie_body ul{
		margin: 0 12px;
		overflow: hidden;
	}
	.movie_body ul li {
		margin-top: 12px;
		display: flex;
		align-items: center;
		border-bottom: 1px solids e6e6e6;
		padding-bottom: 10px;
	}
	.movie_body .pic_show{
		width: 64px ;
		height: 90px;
	}
	.movie_body .pic_show img{
		width: 100%;
	}
	.movie_body .info_list{
		margin-left:10px ;
		flex: 1;
		position: relative;
	}
	.movie_body .info_list h2{
	font-size: 17px ;
	line-height: 24px;
	width: 150px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	}
	.movie_body .info_list p{
		font-size:  13px;
		color: #666;
		line-height: 22px;
		width: 200px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.movie_body .info_list .grade{
		padding-left:3px ;
		font-weight: 700;
		color: #faaf00;
		font-size: 15px;
	}
	.movie_body .info_list img{
		width: 50px;
		position: absolute;
		right: 10px;
		top: 5px;
	}
	.movie_body .btn_mall{
		width: 47px;
		height: 27px;
		line-height: 28px;
		text-align: center;
		background-color: #f03d37;
		color: #fff;
		border-radius: 4px;
		font-size: 12px;
		cursor: pointer;
	}
</style>
